#pragma once
#include "Hash.h"

using namespace hash_table;

namespace zzzyh
{
	template<class K>
	class unordered_set
	{
		
	public:
		struct KFromT
		{
			const K& operator()(const K& t)
			{
				return t;
			}
		};
		typedef typename Hash<K, const K, KFromT>::Iterator  iterator;
		typedef typename Hash<K, const K, KFromT>::ConstIterator  c_iterator;

		pair<iterator, bool> insert(const K& key)
		{
			return _hash.insert(key);
		}

		iterator begin() {
			return _hash.begin();
		}
		iterator end() {
			return _hash.end();
		}

		c_iterator begin() const
		{
			return _hash.begin();
		}
		c_iterator end() const
		{
			return _hash.end();
		}
		iterator find(const K& key)
		{
			return _hash.find(key);
		}

		bool erase(const K& key)
		{
			return _hash.erase();
		}

	private:
		Hash<K, const K, KFromT> _hash;
	};
}